<template>
    <div class="box">
        <h3>{{ msg }}</h3>
        <h3>女儿小红: 有存款: {{ money }}</h3>
        <button @click="giveMoney(100)">给BABA钱: 100</button>
    </div>
</template>

<script>
import mixin from './mixin'
export default {
    name: 'Daughter',
    mixins: [mixin],
    data() {
        return {
            money: 20000
        }
    },
    mounted() {
        console.log('组件的 mounted - daug')
    },
    methods: {
        giveMoney(money) {
            this.money -= money;

            this.$parent.money += money;
        }
    }
}
</script>
